<template>
    <div class="app-container">
        <el-form :model="queryParams" ref="queryForm" size="small" v-show="showSearch" label-width="68px">
            <el-row>
                <el-card shadow="always" style="margin-bottom: 10px;">
                    <el-radio-group v-model="reportType" size="mini">
                        <el-radio border key="41"  label="41">上门/重复上门报表</el-radio>
                        <el-radio border key="42"  label="42">签约/重复签约报表</el-radio>
                        <el-radio border key="43"  label="43">放款/重复放款报表</el-radio>
                        <el-radio border key="44"  label="44">扫码成功/重复扫码成功</el-radio>
                        <el-radio border key="45"  label="45">特殊重复成功</el-radio>
                    </el-radio-group>
                </el-card>
            </el-row>
            <el-row>
                <el-col :span="8">
                    <el-form-item label="时间" prop="timeGroup">
                        <el-date-picker v-model="timeGroup" type="daterange" :picker-options="pickerOptions" editable
                            range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" align="right"
                            value-format="yyyy-MM-dd" format="yyyy-MM-dd" style="width: 100%;">
                        </el-date-picker>
                    </el-form-item>
                </el-col>
                <el-col :span="8">
                    <el-form-item label="部门归属" prop="deptId">
                        <treeselect v-model="deptId" :options="deptOptions" :show-count="true" placeholder="请选择部门归属"
                            :default-expand-level="4" />
                    </el-form-item>
                </el-col>
                <el-col :span="8">
                    <el-form-item>
                        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
                        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
                    </el-form-item>
                </el-col>
            </el-row>
        </el-form>
        <el-row :gutter="10" class="mb8">
            <el-col :span="1.5">
            </el-col>
        </el-row>
        <el-table v-loading="loading" :data="publicCustList">
            <template v-if="reportType == null || reportType==41">
                <el-table-column label="数据类别" align="center" :key="1" >
                    <el-row>上门</el-row>
                    <el-row>重复上门</el-row>
                </el-table-column>
                <el-table-column label="0星" align="center"  :key="2">
                    <template slot-scope="scope">
                      <span class="report_span1" @click="custleveldataDetails(scope.row.l0_visit_cust_ids)"> <el-row prop='l0_visit_cust_ids' >{{ scope.row.l0_visit_count + '/' + scope.row.l0_visit_ratio + '%' }}</el-row></span>
                      <span class="report_span1" @click="custleveldataDetails(scope.row.l0_repeat_visit_cust_ids)"> <el-row prop='l0_visit_ratio'>{{ scope.row.l0_repeat_visit_count + '/' + scope.row.l0_repeat_visit_ratio + '%' }}</el-row></span>
                    </template>
                </el-table-column>
                <el-table-column label="1星客户" align="center"  :key="4">
                    <template slot-scope="scope">
                      <span class="report_span1" @click="custleveldataDetails(scope.row.l1_visit_cust_ids)"><el-row prop='l9_visit_count'>{{ scope.row.l1_visit_count + '/' + scope.row.l1_visit_ratio + '%' }}</el-row></span>
                      <span class="report_span1" @click="custleveldataDetails(scope.row.l1_repeat_visit_cust_ids)"><el-row prop='l1_repeat_visit_count'>{{ scope.row.l1_repeat_visit_count + '/' + scope.row.l1_repeat_visit_ratio + '%' }}</el-row></span>
                    </template>
                </el-table-column>
                <el-table-column label="2星" align="center" :key="5">
                    <template slot-scope="scope">
                      <span class="report_span2" @click="custleveldataDetails(scope.row.l2_visit_cust_ids)"><el-row prop='l2_visit_cust_ids'>{{ scope.row.l2_visit_count + '/' + scope.row.l2_visit_ratio + '%' }}</el-row></span>
                      <span class="report_span2" @click="custleveldataDetails(scope.row.l2_repeat_visit_cust_ids)"><el-row prop='l2_repeat_visit_count'>{{ scope.row.l2_repeat_visit_count + '/' + scope.row.l2_repeat_visit_ratio + '%' }}</el-row></span>
                    </template>
                </el-table-column>
                <el-table-column label="2星+" align="center" :key="6">
                    <template slot-scope="scope">
                      <span class="report_span1" @click="custleveldataDetails(scope.row.l8_visit_cust_ids)"><el-row prop='l8_visit_cust_ids'>{{ scope.row.l8_visit_count + '/' + scope.row.l8_visit_ratio + '%' }}</el-row></span>
                      <span class="report_span1" @click="custleveldataDetails(scope.row.l8_repeat_visit_cust_ids)"><el-row prop='l8_repeat_visit_cust_ids'>{{ scope.row.l8_repeat_visit_count + '/' + scope.row.l8_repeat_visit_ratio + '%' }}</el-row></span>
                    </template>
                </el-table-column>
                <el-table-column label="3星" align="center" :key="8">
                    <template slot-scope="scope">
                      <span class="report_span1" @click="custleveldataDetails(scope.row.l3_visit_cust_ids)"><el-row prop='l3_visit_cust_ids'>{{ scope.row.l3_visit_count + '/' + scope.row.l3_visit_ratio + '%' }}</el-row></span>
                      <span class="report_span1" @click="custleveldataDetails(scope.row.l3_repeat_visit_cust_ids)"><el-row prop='l3_repeat_visit_cust_ids'>{{ scope.row.l3_repeat_visit_count + '/' + scope.row.l3_repeat_visit_ratio + '%' }}</el-row></span>
                    </template>
                </el-table-column>
                <el-table-column label="4星" align="center" :key="9">
                    <template slot-scope="scope">
                      <span class="report_span2" @click="custleveldataDetails(scope.row.l4_visit_cust_ids)"><el-row prop='l4_visit_cust_ids'>{{ scope.row.l4_visit_count + '/' + scope.row.l4_visit_ratio + '%' }}</el-row></span>
                      <span class="report_span2" @click="custleveldataDetails(scope.row.l4_repeat_visit_cust_ids)"><el-row prop='l4_repeat_visit_cust_ids'>{{ scope.row.l4_repeat_visit_count + '/' + scope.row.l4_repeat_visit_ratio + '%' }}</el-row></span>
                    </template>
                </el-table-column>
                <el-table-column label="5星客户" align="center" :key="10" >
                    <template slot-scope="scope">
                      <span class="report_span1" @click="custleveldataDetails(scope.row.l5_visit_cust_ids)"><el-row prop='l5_visit_cust_ids'>{{ scope.row.l5_visit_count + '/' + scope.row.l5_visit_ratio + '%' }}</el-row></span>
                      <span class="report_span1" @click="custleveldataDetails(scope.row.l5_repeat_visit_cust_ids)"><el-row prop='l5_repeat_visit_cust_ids'>{{ scope.row.l5_repeat_visit_count + '/' + scope.row.l5_repeat_visit_ratio + '%' }}</el-row></span>
                    </template>
                </el-table-column>
                <el-table-column label="扫码" align="center" :key="11">
                    <template slot-scope="scope">
                      <span class="report_span2" @click="custleveldataDetails(scope.row.l6_visit_cust_ids)"><el-row prop='l6_visit_cust_ids'>{{ scope.row.l6_visit_count + '/' + scope.row.l6_visit_ratio + '%' }}</el-row></span>
                      <span class="report_span2" @click="custleveldataDetails(scope.row.l6_repeat_visit_cust_ids)"><el-row prop='l6_repeat_visit_cust_ids'>{{ scope.row.l6_repeat_visit_count + '/' + scope.row.l6_repeat_visit_ratio + '%' }}</el-row></span>
                    </template>
                </el-table-column>
                <el-table-column label="总上门" align="center" :key="12">
                    <template slot-scope="scope">
                      <span class="report_span1" @click="custleveldataDetails(scope.row.visit_cust_ids)"><el-row prop='visit_cust_ids'>{{ scope.row.visit_count + '/' + scope.row.visit_ratio + '%' }}</el-row></span>
                      <span class="report_span1" @click="custleveldataDetails(scope.row.repeat_visit_cust_ids)"><el-row prop='repeat_visit_cust_ids'>{{ scope.row.repeat_visit_count + '/' + scope.row.repeat_visit_ratio + '%' }}</el-row></span>
                    </template>
                </el-table-column>
            </template>
            <template v-if="reportType==42">
                <el-table-column label="报表类别" align="center" :key="13">
                    <el-row>签约</el-row>
                    <el-row>重复签约</el-row>
                </el-table-column>
                <el-table-column label="0星" align="center"  :key="14">
                    <template slot-scope="scope">
                      <span class="report_span1" @click="custleveldataDetails(scope.row.l0_sign_cust_ids)"><el-row prop='l0_sign_cust_ids'>{{ scope.row.l0_sign_count + '/' + scope.row.l0_sign_ratio + '%' }}</el-row></span>
                      <span class="report_span1" @click="custleveldataDetails(scope.row.l9_repeat_sign_cust_ids)"><el-row prop='l9_repeat_sign_cust_ids'>{{ scope.row.l9_repeat_sign_count + '/' + scope.row.l9_repeat_sign_ratio + '%' }}</el-row></span>
                    </template>
                </el-table-column>
                <el-table-column label="1星客户" align="center"  :key="16">
                    <template slot-scope="scope">
                      <span class="report_span1" @click="custleveldataDetails(scope.row.l1_sign_cust_ids)"><el-row prop='l1_sign_cust_ids'>{{ scope.row.l1_sign_count + '/' + scope.row.l1_sign_ratio + '%' }}</el-row></span>
                      <span class="report_span1" @click="custleveldataDetails(scope.row.l1_repeat_sign_cust_ids)"><el-row prop='l1_repeat_sign_cust_ids'>{{ scope.row.l1_repeat_sign_count + '/' + scope.row.l1_repeat_sign_ratio + '%' }}</el-row></span>
                    </template>
                </el-table-column>
                <el-table-column label="2星" align="center"  :key="17">
                    <template slot-scope="scope">
                      <span class="report_span2" @click="custleveldataDetails(scope.row.l2_sign_cust_ids)"><el-row prop='l2_sign_cust_ids'>{{ scope.row.l2_sign_count + '/' + scope.row.l2_sign_ratio + '%' }}</el-row></span>
                      <span class="report_span2" @click="custleveldataDetails(scope.row.l2_repeat_sign_cust_ids)"><el-row prop='l2_repeat_sign_cust_ids'>{{ scope.row.l2_repeat_sign_count + '/' + scope.row.l2_repeat_sign_ratio + '%' }}</el-row></span>
                    </template>
                </el-table-column>
                <el-table-column label="2星+" align="center"  :key="18">
                    <template slot-scope="scope">
                      <span class="report_span1" @click="custleveldataDetails(scope.row.l8_sign_cust_ids)"><el-row prop='l8_sign_cust_ids'>{{ scope.row.l8_sign_count + '/' + scope.row.l8_sign_ratio + '%' }}</el-row></span>
                      <span class="report_span1" @click="custleveldataDetails(scope.row.l8_repeat_sign_cust_ids)"><el-row prop='l8_repeat_sign_cust_ids'>{{ scope.row.l8_repeat_sign_count + '/' + scope.row.l8_repeat_sign_ratio + '%' }}</el-row></span>
                    </template>
                </el-table-column>
                <el-table-column label="小贷次级" align="center" :key="19">
                    <template slot-scope="scope">
                      <span class="report_span2" @click="custleveldataDetails(scope.row.l7_sign_cust_ids)"><el-row prop='l7_sign_cust_ids'>{{ scope.row.l7_sign_count + '/' + scope.row.l7_sign_ratio + '%' }}</el-row></span>
                      <span class="report_span2" @click="custleveldataDetails(scope.row.l7_repeat_sign_cust_ids)"><el-row prop='l7_repeat_sign_cust_ids'>{{ scope.row.l7_repeat_sign_count + '/' + scope.row.l7_repeat_sign_ratio + '%' }}</el-row></span>
                    </template>
                </el-table-column>
                <el-table-column label="3星" align="center"  :key="20">
                    <template slot-scope="scope">
                      <span class="report_span2" @click="custleveldataDetails(scope.row.l3_sign_cust_ids)"><el-row prop='l3_sign_cust_ids'>{{ scope.row.l3_sign_count + '/' + scope.row.l3_sign_ratio + '%' }}</el-row></span>
                      <span class="report_span2" @click="custleveldataDetails(scope.row.l3_repeat_sign_cust_ids)"><el-row prop='l3_repeat_sign_cust_ids'>{{ scope.row.l3_repeat_sign_count + '/' + scope.row.l3_repeat_sign_ratio + '%' }}</el-row></span>
                    </template>
                </el-table-column>
                <el-table-column label="4星" align="center"  :key="21">
                    <template slot-scope="scope">
                      <span class="report_span1" @click="custleveldataDetails(scope.row.l4_sign_cust_ids)"><el-row prop='l4_sign_cust_ids'>{{ scope.row.l4_sign_count + '/' + scope.row.l4_sign_ratio + '%' }}</el-row></span>
                      <span class="report_span1" @click="custleveldataDetails(scope.row.l4_repeat_sign_cust_ids)"><el-row prop='l4_repeat_sign_cust_ids'>{{ scope.row.l4_repeat_sign_count + '/' + scope.row.l4_repeat_sign_ratio + '%' }}</el-row></span>
                    </template>
                </el-table-column>
                <el-table-column label="5星客户" align="center"  :key="22">
                    <template slot-scope="scope">
                      <span class="report_span2" @click="custleveldataDetails(scope.row.l5_sign_cust_ids)"><el-row prop='l5_sign_cust_ids'>{{ scope.row.l5_sign_count + '/' + scope.row.l5_sign_ratio + '%' }}</el-row></span>
                      <span class="report_span2" @click="custleveldataDetails(scope.row.l5_repeat_sign_cust_ids)"><el-row prop='l5_repeat_sign_cust_ids'>{{ scope.row.l5_repeat_sign_count + '/' + scope.row.l5_repeat_sign_ratio + '%' }}</el-row></span>
                    </template>
                </el-table-column>
                <el-table-column label="扫码" align="center"  :key="23">
                    <template slot-scope="scope">
                      <span class="report_span1" @click="custleveldataDetails(scope.row.l6_sign_cust_ids)"><el-row prop='l6_sign_cust_ids'>{{ scope.row.l6_sign_count + '/' + scope.row.l6_sign_ratio + '%' }}</el-row></span>
                      <span class="report_span1" @click="custleveldataDetails(scope.row.l6_repeat_sign_cust_ids)"><el-row prop='l6_repeat_sign_cust_ids'>{{ scope.row.l6_repeat_sign_count + '/' + scope.row.l6_repeat_sign_ratio + '%' }}</el-row></span>
                    </template>
                </el-table-column>
                <el-table-column label="总签约" align="center"  :key="24">
                    <template slot-scope="scope">
                      <span class="report_span2" @click="custleveldataDetails(scope.row.sign_cust_ids)"><el-row prop='sign_cust_ids'>{{ scope.row.sign_count + '/' + scope.row.sign_ratio + '%' }}</el-row></span>
                      <span class="report_span2" @click="custleveldataDetails(scope.row.repeat_sign_cust_ids)"><el-row prop='repeat_sign_cust_ids'>{{ scope.row.repeat_sign_count + '/' + scope.row.repeat_sign_ratio + '%' }}</el-row></span>
                    </template>
                </el-table-column>
            </template>
            <template v-if="reportType==43">
                <el-table-column label="报表类别" align="center"  :key="25">
                    <el-row>放款</el-row>
                    <el-row>重复放款</el-row>
                </el-table-column>
                <el-table-column label="0星" align="center"  :key="26">
                    <template slot-scope="scope">
                      <span class="report_span1" @click="custleveldataDetails(scope.row.l0_sign_cust_ids)"><el-row prop='l0_sign_cust_ids'>{{ scope.row.l0_loan_count + '/' + scope.row.l0_loan_ratio + '%' }}</el-row></span>
                      <span class="report_span1" @click="custleveldataDetails(scope.row.l0_repeat_loan_cust_ids)"><el-row prop='l0_repeat_loan_cust_ids'>{{ scope.row.l0_repeat_loan_count + '/' + scope.row.l0_repeat_loan_ratio + '%' }}</el-row></span>
                    </template>
                </el-table-column>
                <el-table-column label="1星客户" align="center"  :key="28">
                    <template slot-scope="scope">
                      <span class="report_span1" @click="custleveldataDetails(scope.row.l1_loan_cust_ids)"><el-row prop='l1_loan_cust_ids'>{{ scope.row.l1_loan_count + '/' + scope.row.l1_loan_ratio + '%' }}</el-row></span>
                      <span class="report_span1" @click="custleveldataDetails(scope.row.l1_repeat_loan_cust_ids)"><el-row prop='l1_repeat_loan_cust_ids'>{{ scope.row.l1_repeat_loan_count + '/' + scope.row.l1_repeat_loan_ratio + '%' }}</el-row></span>
                    </template>
                </el-table-column>
                <el-table-column label="2星" align="center" :key="29">
                    <template slot-scope="scope">
                      <span class="report_span2" @click="custleveldataDetails(scope.row.l2_loan_cust_ids)"><el-row prop='l2_loan_cust_ids'>{{ scope.row.l2_loan_count + '/' + scope.row.l2_loan_ratio + '%' }}</el-row></span>
                      <span class="report_span2" @click="custleveldataDetails(scope.row.l2_repeat_loan_cust_ids)"><el-row prop='l2_repeat_loan_cust_ids'>{{ scope.row.l2_repeat_loan_count + '/' + scope.row.l2_repeat_loan_ratio + '%' }}</el-row></span>
                    </template>
                </el-table-column>
                <el-table-column label="2星+" align="center" :key="30">
                    <template slot-scope="scope">
                      <span class="report_span1" @click="custleveldataDetails(scope.row.l8_loan_cust_ids)"><el-row prop='l8_loan_cust_ids'>{{ scope.row.l8_loan_count + '/' + scope.row.l8_loan_ratio + '%' }}</el-row></span>
                      <span class="report_span1" @click="custleveldataDetails(scope.row.l8_repeat_loan_cust_ids)"><el-row prop='l8_repeat_loan_cust_ids'>{{ scope.row.l8_repeat_loan_count + '/' + scope.row.l8_repeat_loan_ratio + '%' }}</el-row></span>
                    </template>
                </el-table-column>
                <el-table-column label="3星" align="center"  :key="32">
                    <template slot-scope="scope">
                      <span class="report_span1" @click="custleveldataDetails(scope.row.l3_loan_cust_ids)"><el-row prop='l3_loan_cust_ids'>{{ scope.row.l3_loan_count + '/' + scope.row.l3_loan_ratio + '%' }}</el-row></span>
                      <span class="report_span1" @click="custleveldataDetails(scope.row.l3_repeat_loan_cust_ids)"><el-row prop='l3_repeat_loan_cust_ids'>{{ scope.row.l3_repeat_loan_count + '/' + scope.row.l3_repeat_loan_ratio + '%' }}</el-row></span>
                    </template>
                </el-table-column>
                <el-table-column label="4星" align="center"  :key="33">
                    <template slot-scope="scope">
                      <span class="report_span2" @click="custleveldataDetails(scope.row.l4_loan_cust_ids)"><el-row prop='l4_loan_cust_ids'>{{ scope.row.l4_loan_count + '/' + scope.row.l4_loan_ratio + '%' }}</el-row></span>
                      <span class="report_span2" @click="custleveldataDetails(scope.row.l4_repeat_loan_cust_ids)"><el-row prop='l4_repeat_loan_cust_ids'>{{ scope.row.l4_repeat_loan_count + '/' + scope.row.l4_repeat_loan_ratio + '%' }}</el-row></span>
                    </template>
                </el-table-column>
                <el-table-column label="5星客户" align="center"  :key="34">
                    <template slot-scope="scope">
                      <span class="report_span1" @click="custleveldataDetails(scope.row.l5_loan_cust_ids)"><el-row prop='l5_loan_cust_ids'>{{ scope.row.l5_loan_count + '/' + scope.row.l5_loan_ratio + '%' }}</el-row></span>
                      <span class="report_span1" @click="custleveldataDetails(scope.row.l5_repeat_loan_cust_ids)"><el-row prop='l5_repeat_loan_cust_ids'>{{ scope.row.l5_repeat_loan_count + '/' + scope.row.l5_repeat_loan_ratio + '%' }}</el-row></span>
                    </template>
                </el-table-column>
                <el-table-column label="扫码" align="center"  :key="35">
                    <template slot-scope="scope">
                      <span class="report_span2" @click="custleveldataDetails(scope.row.l6_loan_cust_ids)"><el-row prop='l6_loan_cust_ids'>{{ scope.row.l6_loan_count + '/' + scope.row.l6_loan_ratio + '%' }}</el-row></span>
                      <span class="report_span2" @click="custleveldataDetails(scope.row.l6_repeat_loan_cust_ids)"><el-row prop='l6_repeat_loan_cust_ids'>{{ scope.row.l6_repeat_loan_count + '/' + scope.row.l6_repeat_loan_ratio + '%' }}</el-row></span>
                    </template>
                </el-table-column>
                <el-table-column label="总放款" align="center"  :key="36">
                    <template slot-scope="scope">
                      <span class="report_span1" @click="custleveldataDetails(scope.row.loan_cust_ids)"><el-row prop='loan_cust_ids'>{{ scope.row.loan_count + '/' + scope.row.loan_ratio + '%' }}</el-row></span>
                      <span class="report_span1" @click="custleveldataDetails(scope.row.repeat_loan_cust_ids)"><el-row prop='repeat_loan_cust_ids'>{{ scope.row.repeat_loan_count + '/' + scope.row.repeat_loan_ratio + '%' }}</el-row></span>
                    </template>
                </el-table-column>
            </template>
            <template v-if="reportType==44">
                <el-table-column label="报表类别" align="center"  :key="37">
                    <el-row>扫码成功</el-row>
                    <el-row>重复扫码成功</el-row>
                </el-table-column>
                <el-table-column label="0星" align="center"  :key="38">
                    <template slot-scope="scope">
                      <span class="report_span1" @click="custleveldataDetails(scope.row.l0_introduce_cust_ids)"><el-row prop='l0_introduce_cust_ids'>{{ scope.row.l0_introduce_count + '/' + scope.row.l0_introduce_ratio + '%' }}</el-row></span>
                      <span class="report_span1" @click="custleveldataDetails(scope.row.l0_repeat_introduce_cust_ids)"><el-row prop='l0_repeat_introduce_cust_ids'>{{ scope.row.l0_repeat_introduce_count + '/' + scope.row.l0_repeat_introduce_ratio + '%' }}</el-row></span>
                    </template>
                </el-table-column>
                <el-table-column label="1星客户" align="center"  :key="40">
                    <template slot-scope="scope">
                      <span class="report_span1" @click="custleveldataDetails(scope.row.l1_introduce_cust_ids)"><el-row prop='l1_introduce_cust_ids'>{{ scope.row.l1_introduce_count + '/' + scope.row.l1_introduce_ratio + '%' }}</el-row></span>
                      <span class="report_span1" @click="custleveldataDetails(scope.row.l1_repeat_introduce_cust_ids)"><el-row prop='l1_repeat_introduce_cust_ids'>{{ scope.row.l1_repeat_introduce_count + '/' + scope.row.l1_repeat_introduce_ratio + '%' }}</el-row></span>
                    </template>
                </el-table-column>
                <el-table-column label="2星" align="center"  :key="41">
                    <template slot-scope="scope">
                      <span class="report_span2" @click="custleveldataDetails(scope.row.l2_introduce_cust_ids)"><el-row prop='l2_introduce_cust_ids'>{{ scope.row.l2_introduce_count + '/' + scope.row.l2_introduce_ratio + '%' }}</el-row></span>
                      <span class="report_span2" @click="custleveldataDetails(scope.row.l2_repeat_introduce_cust_ids)"><el-row prop='l2_repeat_introduce_cust_ids'>{{ scope.row.l2_repeat_introduce_count + '/' + scope.row.l2_repeat_introduce_ratio + '%' }}</el-row></span>
                    </template>
                </el-table-column>
                <el-table-column label="2星+" align="center"  :key="42">
                    <template slot-scope="scope">
                      <span class="report_span1" @click="custleveldataDetails(scope.row.l8_introduce_cust_ids)"><el-row prop='l8_introduce_cust_ids'>{{ scope.row.l8_introduce_count + '/' + scope.row.l8_introduce_ratio + '%' }}</el-row></span>
                      <span class="report_span1" @click="custleveldataDetails(scope.row.l8_repeat_introduce_cust_ids)"><el-row prop='l8_repeat_introduce_cust_ids'>{{ scope.row.l8_repeat_introduce_count + '/' + scope.row.l8_repeat_introduce_ratio + '%' }}</el-row></span>
                    </template>
                </el-table-column>
                <el-table-column label="小贷次级" align="center"  :key="43">
                    <template slot-scope="scope">
                      <span class="report_span2" @click="custleveldataDetails(scope.row.l7_introduce_cust_ids)"><el-row prop='l7_introduce_cust_ids'>{{ scope.row.l7_introduce_count + '/' + scope.row.l7_introduce_ratio + '%' }}</el-row></span>
                      <span class="report_span2" @click="custleveldataDetails(scope.row.l7_repeat_introduce_cust_ids)"><el-row prop='l7_repeat_introduce_cust_ids'>{{ scope.row.l7_repeat_introduce_count + '/' + scope.row.l7_repeat_introduce_ratio + '%' }}</el-row></span>
                    </template>
                </el-table-column>
                <el-table-column label="3星" align="center"  :key="44">
                    <template slot-scope="scope">
                      <span class="report_span1" @click="custleveldataDetails(scope.row.l3_introduce_cust_ids)"><el-row prop='l3_introduce_cust_ids'>{{ scope.row.l3_introduce_count + '/' + scope.row.l3_introduce_ratio + '%' }}</el-row></span>
                      <span class="report_span1" @click="custleveldataDetails(scope.row.l3_repeat_introduce_cust_ids)"><el-row prop='l3_repeat_introduce_cust_ids'>{{ scope.row.l3_repeat_introduce_count + '/' + scope.row.l3_repeat_introduce_ratio + '%' }}</el-row></span>
                    </template>
                </el-table-column>
                <el-table-column label="4星" align="center"  :key="45">
                    <template slot-scope="scope">
                      <span class="report_span2" @click="custleveldataDetails(scope.row.l4_introduce_cust_ids)"><el-row prop='l4_introduce_cust_ids'>{{ scope.row.l4_introduce_count + '/' + scope.row.l4_introduce_ratio + '%' }}</el-row></span>
                      <span class="report_span2" @click="custleveldataDetails(scope.row.l4_repeat_introduce_cust_ids)"><el-row prop='l4_repeat_introduce_cust_ids'>{{ scope.row.l4_repeat_introduce_count + '/' + scope.row.l4_repeat_introduce_ratio + '%' }}</el-row></span>
                    </template>
                </el-table-column>
                <el-table-column label="5星客户" align="center"  :key="46">
                    <template slot-scope="scope">
                      <span class="report_span1" @click="custleveldataDetails(scope.row.l5_introduce_cust_ids)"><el-row prop='l5_introduce_cust_ids'>{{ scope.row.l5_introduce_count + '/' + scope.row.l5_introduce_ratio + '%' }}</el-row></span>
                      <span class="report_span1" @click="custleveldataDetails(scope.row.l5_repeat_introduce_cust_ids)"><el-row prop='l5_repeat_introduce_cust_ids'>{{ scope.row.l5_repeat_introduce_count + '/' + scope.row.l5_repeat_introduce_ratio + '%' }}</el-row></span>
                    </template>
                </el-table-column>
                <el-table-column label="扫码" align="center"  :key="47">
                    <template slot-scope="scope">
                      <span class="report_span2" @click="custleveldataDetails(scope.row.l6_introduce_cust_ids)"><el-row prop='l6_introduce_cust_ids'>{{ scope.row.l6_introduce_count + '/' + scope.row.l6_introduce_ratio + '%' }}</el-row></span>
                      <span class="report_span2" @click="custleveldataDetails(scope.row.l6_repeat_introduce_cust_ids)"><el-row prop='l6_repeat_introduce_cust_ids'>{{ scope.row.l6_repeat_introduce_count + '/' + scope.row.l6_repeat_introduce_ratio + '%' }}</el-row>
                      </span>
                    </template>
                </el-table-column>
                <el-table-column label="总放款" align="center"  :key="48">
                    <template slot-scope="scope">
                      <span class="report_span1" @click="custleveldataDetails(scope.row.introduce_cust_ids)"><el-row prop='introduce_cust_ids'>{{ scope.row.introduce_count + '/' + scope.row.introduce_ratio + '%' }}</el-row></span>
                      <span class="report_span1" @click="custleveldataDetails(scope.row.repeat_introduce_cust_ids)"><el-row prop='repeat_introduce_cust_ids'>{{ scope.row.repeat_introduce_count + '/' + scope.row.repeat_introduce_ratio + '%' }}</el-row></span>
                    </template>
                </el-table-column>
            </template>
            <template v-if="reportType==45">
                <el-table-column label="报表类别" align="center"  :key="49">
                    <el-row>特殊重复成功</el-row>
                </el-table-column>
                <el-table-column label="0星" align="center"  :key="1">
                    <template slot-scope="scope">
                      <span class="report_span1" @click="custleveldataDetails(scope.row.l0_repeat_special_cust_ids)"><el-row prop='l0_repeat_special_cust_ids'>{{ scope.row.l0_repeat_special_count + '/' + scope.row.l0_repeat_special_ratio + '%' }}</el-row></span>
                    </template>
                </el-table-column>
                <el-table-column label="1星客户" align="center"  :key="51">
                    <template slot-scope="scope">
                      <span class="report_span1" @click="custleveldataDetails(scope.row.l1_repeat_special_cust_ids)"><el-row prop='l1_repeat_special_cust_ids'>{{ scope.row.l1_repeat_special_count + '/' + scope.row.l1_repeat_special_ratio + '%' }}</el-row></span>
                    </template>
                </el-table-column>
                <el-table-column label="2星" align="center"  :key="52">
                    <template slot-scope="scope">
                      <span class="report_span2" @click="custleveldataDetails(scope.row.l2_repeat_special_cust_ids)"><el-row prop='l2_repeat_special_cust_ids'>{{ scope.row.l2_repeat_special_count + '/' + scope.row.l2_repeat_special_ratio + '%' }}</el-row></span>
                    </template>
                </el-table-column>
                <el-table-column label="2星+" align="center"  :key="53">
                    <template slot-scope="scope">
                      <span class="report_span1" @click="custleveldataDetails(scope.row.l8_repeat_special_cust_ids)"><el-row prop='l8_repeat_special_cust_ids'>{{ scope.row.l8_repeat_special_count + '/' + scope.row.l8_repeat_special_ratio + '%' }}</el-row></span>
                    </template>
                </el-table-column>
                <el-table-column label="3星" align="center"  :key="55">
                    <template slot-scope="scope">
                      <span class="report_span1" @click="custleveldataDetails(scope.row.l3_repeat_special_cust_ids)"><el-row prop='l3_repeat_special_cust_ids'>{{ scope.row.l3_repeat_special_count + '/' + scope.row.l3_repeat_special_ratio + '%' }}</el-row></span>
                    </template>
                </el-table-column>
                <el-table-column label="4星" align="center"  :key="56">
                    <template slot-scope="scope">
                      <span class="report_span2" @click="custleveldataDetails(scope.row.l4_repeat_special_cust_ids)"><el-row prop='l4_repeat_special_cust_ids'>{{ scope.row.l4_repeat_special_count + '/' + scope.row.l4_repeat_special_ratio + '%' }}</el-row></span>
                    </template>
                </el-table-column>
                <el-table-column label="5星客户" align="center"  :key="57">
                    <template slot-scope="scope">
                      <span class="report_span1" @click="custleveldataDetails(scope.row.l5_repeat_special_cust_ids)"><el-row prop='l5_repeat_special_cust_ids'>{{ scope.row.l5_repeat_special_count + '/' + scope.row.l5_repeat_special_ratio + '%' }}</el-row></span>
                    </template>
                </el-table-column>
                <el-table-column label="扫码" align="center"  :key="58">
                    <template slot-scope="scope">
                      <span class="report_span2" @click="custleveldataDetails(scope.row.l6_repeat_special_cust_ids)"><el-row prop='l6_repeat_special_cust_ids'>{{ scope.row.l6_repeat_special_count + '/' + scope.row.l6_repeat_special_ratio + '%' }}</el-row></span>
                    </template>
                </el-table-column>
                <el-table-column label="总特殊重复" align="center"  :key="59">
                    <template slot-scope="scope">
                      <span class="report_span1" @click="custleveldataDetails(scope.row.repeat_special_cust_ids)"><el-row prop='repeat_special_cust_ids'>{{ scope.row.repeat_special_count + '/' + scope.row.repeat_special_ratio + '%' }}</el-row></span>
                    </template>
                </el-table-column>
            </template>
        </el-table>
        <!-- 查看客户列表 -->
        <el-dialog :title="title" :visible.sync="open" class="dialogCust" width="96%" :fullscreen="modal" append-to-body :modal="modal" :destroy-on-close="modal">
          <cust-info-list :form.sync="form"></cust-info-list>
        </el-dialog>
    </div>
</template>

<script>
import { getTransactionDatas } from "@/api/crmsys/report/custStatics";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import Treeselect from "@riophae/vue-treeselect";
import { childrenAlldeptTree } from "@/api/system/user";
import {
    getAllDeptandUsers
} from "@/api/crmsys/custinfo/custinfo";
import CustInfoList from "@/components/crmSys/custInfoList";

export default {
    name: "TeamCustDataStatics",
    components: { Treeselect, CustInfoList},
    dicts: [
        "crm_customerStatus"
    ],
    data() {
        return {
            open:false,
            modal:false,
            title:'客户列表',
            form:{},//通过from去子组件查询列表数据
            timeGroup: null,
            reportType:"41",
            deptId :null,
            // 周目标管理表格数据
            publicCustList: [],
            // 部门归属树选项
            deptOptions: [],
            sysUsersList: [],
            rightType :4,
            queryParams: {
                level: "6",
                status: "-1",
                params: {
                }
            },
            // 显示搜索条件
            showSearch: true,
            // 遮罩层
            loading: false,
            pickerOptions: {
                shortcuts: [{
                    text: '最近一周',
                    onClick(picker) {
                        const end = new Date();
                        const start = new Date();
                        start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
                        picker.$emit('pick', [start, end]);
                    }
                }, {
                    text: '最近一个月',
                    onClick(picker) {
                        const end = new Date();
                        const start = new Date();
                        start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
                        picker.$emit('pick', [start, end]);
                    }
                }, {
                    text: '最近三个月',
                    onClick(picker) {
                        const end = new Date();
                        const start = new Date();
                        start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
                        picker.$emit('pick', [start, end]);
                    }
                }]
            },
        }
    },
    watch:{
        reportType(newvalue, oldvalue) {
            this.publicCustList=[];
        }
    },
    // 生命周期 - 创建完成（访问当前this实例）
    created() {
        this.getDeptTree();
        this.getDeptAndUsers();
    },
    // 生命周期 - 挂载完成（访问DOM元素）
    mounted() {

    },
    // methods方法
    methods: {
        /** 查询周目标管理列表 */
        getList() {
            if(this.timeGroup==null){
                this.$message.error(`请输入申请时间!`);
                return;
            }
            this.loading = true;
            let deptId=this.deptId==null?-1:this.deptId;
            getTransactionDatas(this.timeGroup,this.reportType,deptId).then(response => {
                this.publicCustList = response.rows;
                console.log(this.publicCustList)
                this.loading = false;
            });
        },
        // 取消按钮
        cancel() {
            this.open = false;
            this.reset();
        },
        // 表单重置
        reset() {
            this.form = {
                id: null,
                empId: null,
                orgId: null,
                visit: null,
                signed: null,
                addFriend: null,
                introduce: null,
                introduceVisit: null,
                introduceSigned: null,
                smsfollow: null,
                callTime: null,
                goalDate: null,
                createTime: null,
                updateTime: null
            };
            this.resetForm("form");
        },
        /** 搜索按钮操作 */
        handleQuery() {
            this.queryParams.pageNum = 1;
            this.getList();
        },
        /** 重置按钮操作 */
        resetQuery() {
            this.resetForm("queryForm");
            this.handleQuery();
        },
        /** 查询部门归属下拉树结构 */
        getDeptTree() {
            var dept = { deptId: this.$store.state.user.deptid }
            childrenAlldeptTree(dept).then(response => {
                this.deptOptions = response.data;
            });
        },
        /** 获取部门归属和人员信息 */
        getDeptAndUsers() {
            getAllDeptandUsers().then((response) => {
                this.sysUsersList = response.data.sysUsersList;
            });
        },
        custleveldataDetails(ids) {
          //查询明细数据
          let inparams={};
          inparams.params={};
          inparams.params.ids=ids;
          inparams.pageNum=1;
          inparams.pageSize=10;
          this.$set(this.$data, 'form', inparams);
          this.open=true;
        },
    }
}
</script>

<style lang="scss" scoped>
@import '@/assets/styles/command.scss';
.report_span1 {
  color: blue;
  cursor: pointer;
}
.report_span2 {
  color: rgb(231, 62, 146);
  cursor: pointer;
}
</style>
